package com.lagou.rpc.consumer;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import com.lagou.rpc.pojo.User;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ZookeeperClientBootStrapApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(ZookeeperClientBootStrapApplication.class, args);
    }

    @Override
    public void run(String... args) {
        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
        User user1 = userService.getById(1);
        User user2 = userService.getById(2);
        User user3 = userService.getById(2);
        User user4 = userService.getById(2);
        User user5 = userService.getById(2);
        User user6 = userService.getById(2);
        User user7 = userService.getById(2);
        User user8 = userService.getById(2);
        System.out.println(user1);
        System.out.println(user2);
        System.out.println(user3);
        System.out.println(user4);
        System.out.println(user5);
        System.out.println(user6);
        System.out.println(user7);
        System.out.println(user8);
    }

}
